import {request} from './request'

export function loginSubmit(username, password){
    return request({
        url: '/login',
        data: {
            username: username,
            password: password,
        },
        method: 'post'
    })
}

export function registerSubmit(username, password1, password2){
    return request({
        url: '/register',
        data: {
            username: username,
            password1: password1,
            password2: password2,
        },
        method: 'post'
    })
}

export function returnComments(sellername){
    return request({
        url: '/product',
        params: {
            username:sellername,
        }
    })
}

//product页面需要请求用户评价

export function postNeed(need, time){
    return request({
        url: '/releaseNeeds',
        data: {
            description: need,
            time: time
        },
        method: 'post'
    })
}